<#assign title="重置密码" /><#include 'common/header.html' />
<link rel="stylesheet" href="${ctx}/themes/default/css/member.css" type="text/css" />
<#assign checkFindPwdTag=newTag("checkFindPwdTag")/>
<#assign checkFindPwd=checkFindPwdTag("{'s':'${s}' }") />
<div id="findpwd_wrapper">
<!-- 判断s码是否正确 0为成功,1为失败 -->
<#if checkFindPwd.type==0>
	<form  id="findPasswordForm" method="post"  class="validate">
		<input type="hidden" name="s" value="${checkFindPwd.s}"/>
		<input type="hidden" name="email" value="${checkFindPwd.email}"/><br/>
		<table cellspacing="0" cellpadding="0" border="0" width="100%">
			<tbody>
				<tr>
					<th><i>*</i>&nbsp;&nbsp;输入密码：</th>
					<td>
					<input id="passwd" name="password" type="password" isrequired="true"   class="inputstyle _x_ipt" tabindex="1" autocomplete="off" />
					</td>
				</tr>
				<tr>
					<th><i>*</i>&nbsp;&nbsp;确认密码：</th>
					<td>
					<input id="conpasswd" type="password"   tabindex="2" name="conpasswd"  class="inputstyle _x_ipt" fun='checkpwd' autocomplete="off" isrequired="true"  />
					</td>
				</tr>		
				 
				<tr>
					<th></th>
					<td>
					<div class="btn"><input type="type" value="修改" id="apply" class="yellow_btn"></div>
					
					</td>
				</tr>
			</tbody>
		</table>
	</form>
<#else>
	${checkFindPwd.message}	
</#if>
</div>

	
	
<script type="text/javascript">
$(function(){
	$("#apply").click(function(){
		if(!$("#findPasswordForm").checkall())
			return false;
		if($("#passwd").val()!=$("#conpasswd").val()){
			alert("密码不一致");
			return false;
		}
		var options = {
				url : "${ctx}/api/shop/findPasswordbyEmail!modify.do?ajax=yes",
				type : "POST",
				dataType : "json",
				success : function(result) {
					if(result.result==0){
						alert(result.message);
					}else{
						location.href="index.html";
						alert(result.message);
					}
			 	},
			 	error : function(e) {
			 		alert('出现错误，请重试');
				}
			};
		
		$("#findPasswordForm").ajaxSubmit(options);
	});
})
</script>
<#include 'common/footer.html' />